-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Allow wildcard ("*") patterns in ambient module declarations #8939
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
7943883
to
ff70666
Compare
ff70666
to
3b19825
Compare
@@ -2135,6 +2136,18 @@ namespace ts { | |||
[index: string]: Symbol; | |||
} | |||
|
|||
/** Represents a "prefix*suffix" pattern. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/* @internal */
as well
@vladima can you take a look? |
@@ -17627,6 +17641,10 @@ namespace ts { | |||
if (!isExternalOrCommonJsModule(file)) { | |||
mergeSymbolTable(globals, file.locals); | |||
} | |||
if (file.patternAmbientModules && file.patternAmbientModules.length) { | |||
(patternAmbientModules || (patternAmbientModules = [])).push(...file.patternAmbientModules); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i remember we had issues with this pattern for diagnostics, and concat fared better there. consider using patternAmbientModules = concatenate(patternAmbientModules , file.patternAmbientModules)
instead.
Can you add a you add one more test with a relative file name: declare module "*!text" { .. }
import f from "./file!text"; |
other than that 👍 |
Half of #6615